
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>查看预测结果 - 低位龙头股分析系统</title>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css">
        <style>
            .header {
                background-color: #343a40;
                color: white;
                padding: 2rem 0;
                margin-bottom: 2rem;
            }
            .card {
                margin-bottom: 1.5rem;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            }
            .card-header {
                background-color: #f8f9fa;
                font-weight: bold;
            }
            .chart-container {
                margin-top: 1.5rem;
                text-align: center;
            }
            .chart-container img {
                max-width: 100%;
                height: auto;
                margin-bottom: 1rem;
            }
        </style>
    </head>
    <body>
        <div class="header">
            <div class="container">
                <h1>查看预测结果</h1>
                <p>预测的下一批低位龙头股</p>
            </div>
        </div>
        
        <div class="container">
            <div class="mb-3">
                <a href="/results" class="btn btn-primary">返回结果列表</a>
                <a href="/" class="btn btn-secondary">返回首页</a>
            </div>
            
            <div class="card">
                <div class="card-header">预测的低位龙头股列表</div>
                <div class="card-body">
                    {% if data %}
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th>排名</th>
                                        <th>股票名称</th>
                                        <th>行业</th>
                                        <th>基础评分</th>
                                        <th>行业热度</th>
                                        <th>热度加成</th>
                                        <th>调整后评分</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% for stock in data %}
                                    <tr>
                                        <td>{{ loop.index }}</td>
                                        <td>{{ stock.name }}({{ stock.code }})</td>
                                        <td>{{ stock.industry }}</td>
                                        <td>{{ "%.2f"|format(stock.total_score) }}</td>
                                        <td>{{ "%.2f"|format(stock.industry_heat) }}</td>
                                        <td>{{ "%.2f"|format(stock.heat_bonus) }}</td>
                                        <td>{{ "%.2f"|format(stock.adjusted_score) }}</td>
                                    </tr>
                                    {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    {% else %}
                        <div class="alert alert-info">
                            无预测结果数据
                        </div>
                    {% endif %}
                </div>
            </div>
            
            {% if prediction_chart %}
            <div class="chart-container">
                <h4>预测的下一批低位龙头股</h4>
                <img src="/{{ prediction_chart }}" alt="预测结果">
            </div>
            {% endif %}
            
            {% if industry_chart %}
            <div class="chart-container">
                <h4>预测低位龙头股行业分布</h4>
                <img src="/{{ industry_chart }}" alt="行业分布">
            </div>
            {% endif %}
        </div>
        
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
    </body>
    </html>
    